package com.saint.farmshop.Mapper.MapperImpl;

import com.saint.farmshop.Entity.ProductionType;
import com.saint.farmshop.Mapper.ProductionTypeMapper;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * 产品类型映射器实现类
 *
 * @author Saint
 * @date 2022/05/22
 */
@Repository
public class ProductionTypeMapperImpl implements ProductionTypeMapper {

    @Resource
    MongoTemplate mongoTemplate;

    final String COLLECTION_NAME = "type_list";

    @Override
    public List<ProductionType> getTypeList() {
        return mongoTemplate.findAll(ProductionType.class,COLLECTION_NAME);
    }

}
